package com.alogic.cron.matcher;

import com.alogic.cron.CronMatcher;
import com.anysoft.util.Properties;

/**
 * 调度时间匹配器(只调度一次)
 *
 * @since 1.6.13.7 [20200720 duanyy] <br>
 */
public class Once extends CronMatcher.Abstract {
	/**
	 * 已调度次数
	 */
	protected int count = 0;

	public Once(){

	}

	public Once(String expr){

	}

	public void configure(Properties p) {
		//nothing to do
	}

	@Override
	public boolean match(long lastDate, long now) {
		count ++;
		return count <= 1;
	}
}
